﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GCGuiShu.aspx.cs" Inherits="Xiaov.SmartWeb.Application.TZGC.GCGuiShu" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type='text/javascript' src='../../SupCan/binary/dynaload.js?60'></script>
    <script type="text/javascript" language="javascript">
        var bAFReady = false;
        var bAF1Ready = false;
        function OnReady(id) {
            var xmid = "<%=xmid %>";
            if (id == "AF") {
                document.AF.func("Build", "GCWGS.xml");
                var ddl_gczt = document.getElementById("se_gczt");
                var gczt = ddl_gczt.options[ddl_gczt.selectedIndex].value;
                document.AF.func("Load", "GcData.aspx?xmgc=false&xmid=" + escape(xmid) + "&gczt=" + escape(gczt));
                bAFReady = true;
            }
            else if (id == "AF1") {
                document.AF1.func("Build", "GCGS.xml");
                document.AF1.func("Load", "GcData.aspx?xmgc=true&xmid=" + escape(xmid));
                bAF1Ready = true;
            }
            if (bAFReady && bAF1Ready) enableDrag();
        }
        function enableDrag() {
            //AF <==> AF1
            var handle = document.AF.func("GetHandle", "");
            document.AF1.func("EnableDrag", handle);
            handle = document.AF1.func("GetHandle", "");
            document.AF1.func("EnableDrag", handle);
        }
        function saveList() {
            var hdGcWgsData = document.AF.func("GetChangedXML", "level=2;isValidateKey=false");
            var hdGcWgs = document.getElementById('<%=HDGcWgs.ClientID%>');
            hdGcWgs.value = hdGcWgsData;

            var hdGcYgsData = document.AF1.func("GetChangedXML", "level=2;isValidateKey=false");
            var hdGcYgs = document.getElementById('<%=HDGcYgs.ClientID%>');
            hdGcYgs.value = hdGcYgsData;
            return true;
        }
        function queryData() {
            var xmid = "<%=xmid %>";
            var gcmc = document.getElementById("t_gcmc").value;
            var ddl_gczt = document.getElementById("se_gczt");
            var gczt = ddl_gczt.options[ddl_gczt.selectedIndex].value;
            document.AF.func("Load", "GcData.aspx?xmgc=false&xmid=" + escape(xmid) + "&gcmc=" + escape(gcmc) + "&gczt=" + escape(gczt));
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div style="text-align: right; width: auto;">
        <asp:HiddenField ID="HDGcWgs" runat="server"></asp:HiddenField>
        <asp:HiddenField ID="HDGcYgs" runat="server"></asp:HiddenField>
    </div>
    <table style="text-align: center; width: 100%; height: 5%">
        <tr>
            <td style="width: 95%; font-size: 16pt; font-weight: bolder">
                <%=xmmc %>
            </td>
            <td align="right">
                <asp:Button ID="btn_save" runat="server" Text="保存" OnClientClick="return saveList();"
                    OnClick="btn_save_Click" />
            </td>
        </tr>
    </table>
    <table style="text-align: center; width: 100%; height: 95%">
        <tr style="height: 100%">
            <td style="width: 46%">
                <table style="text-align: center; width: 100%; height: 100%">
                    <tr style="height: 5%">
                        <td style="font-size: 16pt; font-weight: bolder">
                            工程列表
                        </td>
                    </tr>
                    <tr style="height: 5%; text-align: right">
                        <td style="font-size: 10pt">
                            工程名称<input type="text" id="t_gcmc" />
                            工程状态<select id="se_gczt"><option value="all">全部</option>
                                <option value="0" selected="selected">未完成</option>
                                <option value="1">已完成</option>
                            </select>
                            <input type="button" id="btn_query" onclick="queryData();" value="查询" />
                        </td>
                    </tr>
                    <tr style="height: 90%">
                        <td>
                            <script language="javascript" type="text/javascript">
                                insertTreeList('AF', '')          
                            </script>
                        </td>
                    </tr>
                </table>
            </td>
            <td style="width: 2%">
            </td>
            <td style="width: 46%">
                <table style="text-align: center; width: 100%; height: 100%">
                    <tr style="height: 10%">
                        <td style="font-size: 16pt; font-weight: bolder">
                            <%=xmmc %>工程列表
                        </td>
                    </tr>
                    <tr style="height: 90%">
                        <td>
                            <script language="javascript" type="text/javascript">
                                insertTreeList('AF1', '')          
                            </script>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
